import { createI18n } from "vue-i18n";

import enConfig from "tdesign-vue-next/es/locale/en_US";
import zhConfig from "tdesign-vue-next/es/locale/zh_CN";

import enLocale from "./en";
import zhLocale from "./zh";

const messages = {
  en: {
    ...enLocale,
    ...zhConfig,
  },
  zh: {
    ...zhLocale,
    ...enConfig,
  },
};

const i18n = createI18n({
  legacy: false,
  globalInjection: true,
  locale: "zh",
  messages,
});

export default i18n;
